import { createI18n } from 'vue-i18n';

const getStoredLanguage = (): string => {
    const storedLang = localStorage.getItem('lang');
    return storedLang || 'ja'; // 默认语言为日语
};

const i18n = createI18n({
    legacy: false,
    locale: getStoredLanguage(), // 设置默认语言环境
    fallbackLocale: 'en', // 回退语言
    availableLocales: ['zh', 'ja', 'en']
});

export default i18n;
